import { NIM } from './index'

type V2NIMTestCheckOptions = {
  val: string
}

interface V2NIMTestService {
  check(options: V2NIMTestCheckOptions): void
}

// 想把 test service 作为插件给注册到 index 上. 打包时把公共依赖抽走.
export default class V2NIMTestServiceImpl implements V2NIMTestService {
  static pluginName = 'V2NIMTestService'
  accountId: string = ''
  core: NIM

  constructor(core: NIM) {
    this.core = core
    this.core.logUtil.log('V2NIMTestServiceImpl initialized')
  }

  // 重置模块数据
  reset() {}

  check() {
    console.log('V2NIMTestServiceImpl check')
  }

  // 销毁模块
  destroy() {
    this.reset()
  }
}
